package graphicinterface;

import javax.swing.ImageIcon;

public class GetsBookCoverByImageAddress 
{
	public static ImageIcon getBookCover(String imageAddress)
	{
		ImageIcon bookCover = CreatesImageIcon.createImageIconFromUrl(imageAddress, "one cover");
		
		if(bookCover == null)
		{
			//no image was found on the specified imageAddress
			//let's create a cover with the "book cover not found" image.
			bookCover = CreatesImageIcon.createImageIcon("images/bookcovernotfound.jpg", "book cover not found");
			
		}
		
		return bookCover;
	}

}
